package com.newland.starpos.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.newland.starpos.base.exception.CustomException;
import com.newland.starpos.http.ResponseModel;
import com.newland.starpos.partner.service.UserService;
import com.newland.starpos.utils.StringUtils;

@Controller
@RequestMapping(value = "/user")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping(value = "/phone/exist")
	public @ResponseBody ResponseModel checkPhoneExist(String phoneNumber) throws CustomException{
		
		StringUtils.checkPhoneNumber(phoneNumber);
		ResponseModel response = userService.findUserPhoneExist(phoneNumber);
		return response;
	}
	
}
